package com.example.news.activity;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.view.Window;

import com.example.news.R;
import com.umeng.message.PushAgent;

public class WelcomeActivity extends Activity {

    Handler handler=new Handler(){
        public void handleMessage(android.os.Message msg) {
            if (msg.what==0) {
                //跳转到主页面
                startActivity(new Intent(WelcomeActivity.this,MainActivity.class));
                //关闭当前页面
                finish();
            }
        };
    };

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_NO_TITLE);//隐藏系统自带的标题栏
        setContentView(R.layout.activity_welcome);

        //延迟3秒发送消息
        handler.sendEmptyMessageDelayed(0, 3000);

        PushAgent.getInstance(this).onAppStart();
    }

}
